{% extends "base.html" %}
{% block title %}
	{% if href = '/blog/list/type=all/' %}
		blog:{{blog.title}}
	{% else %}
		学无止境:{{blog.title}}
	{% endif %}
{% endblock %}
{% block banner %}
	{% if href = '/blog/list/type=all/' %}
	<div id='top-sec-nav' style='border-bottom: 2px solid rgba(7, 145, 247, 0.6);'>
		<div class='banner-nav-left'>
			<a href='{{href}}'>
				<div style='float: left; width: 50%; background: rgba(7, 145, 247, 0.4);'><p>{{title}}</p></div>
			</a>	
			<div style='float: left; width: 50%; background: rgba(7, 145, 247, 0.6);'><p style='color:#007bc4'>预览</p></div>
		</div>
		<div class='banner-nav-lable'><p>人生应如满天的群星，生存的意义在于留下一点闪光。</p></div>
	</div>
	{% else %}
	<div id='top-sec-nav' style='border-bottom: 1px solid rgba(190,255,0,0.6);'>
		<div class='banner-nav-left'>
			<a href='{{href}}'>
				<div style='float: left; width: 50%; background: rgba(190,255,0,0.4);'><p>{{title}}</p></div>
			</a>	
			<div style='float: left; width: 50%; background: rgba(190,255,0,0.6);'><p style='color:#007bc4'>预览</p></div>
		</div>
		<div class='banner-nav-lable'><p>书山有路勤为径 ,学海无涯苦作舟!</p></div>
	</div>
	{% endif %}
{% endblock %}
{% block container %}
	<div class="blog-view">
		<div class="blog-left">
			<div class='blog-view-tile'><h3><p style='color:black;'>{{ blog.title }}</p></h3></div>
			{% if blog.author.first_name != ''%}
				<div class='blog-view-info'><pre style='padding-left:10px;font-family: cursive;'>作者:{{ blog.author.first_name }}{{ blog.author.last_name}}  发布时间:{{ blog.timestamp }}  浏览:{{ blog.clicktime}}</pre></div>
			{% else %}
				<div class='blog-view-info'><pre style='padding-left:10px;font-family: cursive;'>作者:{{ blog.author}}  发布时间:{{ blog.timestamp }}  浏览:{{ blog.clicktime}}</pre></div>
			{% endif %}
			<div class='blog-view-body'><pre style='margin-left: 10px; color:black;'><p>{{ blog.body }}</p></pre></div>
			<div class='blog-next'>
				{% if pre.id == blog.id %}
					<div class='blog-next-left'><p>当前篇:{{ pre.title }}</p></div>
				{% else %}
					<div class='blog-next-left'><a href='/blog/article/{{pre.id}}/'><p>上一篇:{{pre.title}}</p></a></div>
				{% endif %}
				{% if next.id == blog.id %}
					<div class='blog-next-right'><p>当前篇:{{ next.title }}</p></div>
				{% else %}
					<div class='blog-next-right'><a href='/blog/article/{{next.id}}/'><p>下一篇:{{next.title}}</p></a></div>
				{% endif %}
			</div>
			
			<div class="bshare-custom icon-medium">
			<div class="bsPromo bsPromo2"></div>
				<a title="分享到微信" class="bshare-weixin" href="javascript:void(0);"></a>
				<a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
				<a title="分享到QQ空间" class="bshare-qzone" href="javascript:void(0);"></a>
				<a title="分享到腾讯微博" class="bshare-qqmb"></a>
			</div>
			<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&amp;uuid=&amp;pophcol=1&amp;lang=zh"></script>
			<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
			
			<div class='comment-body' >
				<form method='post' action="/blog/comment/{{blog.id}}/">
					<div>
						{{form.content}}
						
					</div>
					<div style='clear:both;'>
						{% if form.errors %}
							<div class='error-msg-add-blog'>
								<div class='help-block'>{{ form.content.errors }}</div>
							</div>
						{% endif %}
						<button class='comment-btn'>发布</button>
					</div>
				</form>
			</div>
			
				{% for comment in comments %}
				<div id='comment-display'>
					<div id='comment-info'>
						<p>{{comment.timestamp}} </p>
						<!-- <div style='width:40px;float:right;'><p><a href='#'>赞同{{ comment.agree }}</a></p></div> -->
					</div>
					<div id='comment-body-info'><pre>{{comment.content}}</pre></div>
				</div>
				{% endfor %}
			
		</div>	
		<div class='blog-right' style='margin-top:10px; border-left:2px solid rgba(141,59,181,0.5);' >
			{% if href = '/blog/list/type=all/' %}
				
				<div style='border-bottom: 1px solid rgba(49, 54, 204, 0.5);'><p class='fenlei-p'>旅行日志</p></div>
				<div class='new-blog'>
					{% for new in travels %}
						<a href='/blog/travel/{{ new.id }}/'><div><p>{{ new.title }}</p></div></a>
					{% endfor %}
				</div>
				<div style='border-bottom: 1px solid rgba(200, 108, 212, 0.5);'><p class='fenlei-p'>图片欣赏</p></div>
				<div id='blog-list-right-midd'>
					<ul class="blog-list-right-banner">   
						{% for pic in pics %}
						<li><a href='/blog/pic/{{pic.id}}' target='view_window'><img alt='{{pic.title}}' src="/media/{{pic.first_pic}}" style='width:100%;height:100%;'></a></li> 
						{% endfor%}
					 </ul> 
				</div>
				<div style='border-bottom: 1px solid rgba(81, 204, 49, 0.5);'><p class='fenlei-p'>学无止境</p></div>
				<div class='new-blog'>
					{% for new in learnblogs %}
						<a href='/blog/article/{{ new.id }}/'><div><p>{{ new.title }}</p></div></a>
					{% endfor %}
				</div>
			{% else %}
				<div style='border-bottom: 1px solid rgba(204, 191, 49, 0.5);'>
					<p class='fenlei-p'>分类</p>
				</div>
				<div id='learn-types'>
					<div class='learn-type'>
						{% for type in types %}
							<a href='/blog/learn/{{type.id}}' target="_blank"><p>{{ type.type}}</p></a>
						{% endfor %}
					</div>
				</div>
				<div style='border-bottom: 1px solid rgba(81, 204, 49, 0.5);'><p class='fenlei-p'>blog推荐</p></div>
				<div class='new-blog'>
					{% for new in newblogs %}
						<a href='/blog/article/{{ new.id }}/'><div><p>{{ new.title }}</p></div></a>
					{% endfor %}
				</div>
				<div style='border-bottom: 1px solid rgba(49, 54, 204, 0.5);'><p class='fenlei-p'>旅行日志</p></div>
				<div class='new-blog'>
					{% for new in travels %}
						<a href='/blog/travel/{{ new.id }}/'><div><p>{{ new.title }}</p></div></a>
					{% endfor %}
				</div>
				<div style='border-bottom: 1px solid rgba(200, 108, 212, 0.5);'><p class='fenlei-p'>图片欣赏</p></div>
				<div id='blog-list-right-midd'>
					<ul class="blog-list-right-banner">   
						{% for pic in pics %}
						<li><a href='/blog/pic/{{pic.id}}' target='view_window'><img alt='{{pic.title}}' src="/media/{{pic.first_pic}}" style='width:100%;height:100%;'></a></li> 
						{% endfor%}
					 </ul> 
				</div>
				
			{% endif %}
		</div>
	</div>
	
{% endblock %}
